<!-- HTML header for doxygen 1.8.8-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <!-- For Mobile Devices -->
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
        <meta name="generator" content="Doxygen 1.8.18"/>
        <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
        <title>HElib: /HElib/src/binaryArith.cpp File Reference</title>
        <!--<link href="tabs.css" rel="stylesheet" type="text/css"/>-->
        <script type="text/javascript" src="dynsections.js"></script>
        <link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
        <link href="doxygen.css" rel="stylesheet" type="text/css" />
        <link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
        <link href='https://fonts.googleapis.com/css?family=Roboto+Slab' rel='stylesheet' type='text/css'>
		<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100;1,700&family=Merriweather&family=Merriweather+Sans&family=Open+Sans&family=Poppins:ital@1&family=Roboto:ital,wght@0,400;1,300;1,900&display=swap" rel="stylesheet"> 
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
        <link href="jquery.smartmenus.bootstrap.css" rel="stylesheet">
        <script type="text/javascript" src="jquery.smartmenus.js"></script>
        <!-- SmartMenus jQuery Bootstrap Addon -->
        <script type="text/javascript" src="jquery.smartmenus.bootstrap.js"></script>
        <!-- SmartMenus jQuery plugin -->
    </head>
    <body style="font-family: 'Merriweather', serif;">
        <nav class="navbar navbar-default" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <a class="navbar-brand">HElib Implementing Homomorphic Encryption</a>
                </div>
            </div>
        </nav>
        <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
            <div class="content" id="content">
                <div class="container">
                    <div class="row">
                        <div class="col-sm-12 panel " style="padding-bottom: 15px;">
                            <div style="margin-bottom: 15px;">
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#namespaces">Namespaces</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">binaryArith.cpp File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Implementing integer addition, multiplication in binary representation.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;numeric&gt;</code><br />
<code>#include &lt;climits&gt;</code><br />
<code>#include &lt;map&gt;</code><br />
<code>#include &lt;algorithm&gt;</code><br />
<code>#include &lt;stdexcept&gt;</code><br />
<code>#include &lt;atomic&gt;</code><br />
<code>#include &lt;mutex&gt;</code><br />
<code>#include &lt;NTL/BasicThreadPool.h&gt;</code><br />
<code>#include &lt;<a class="el" href="binary_arith_8h_source.html">helib/binaryArith.h</a>&gt;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhelib_1_1_d_a_gnode.html">helib::DAGnode</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A node in an addition-DAG structure.  <a href="classhelib_1_1_d_a_gnode.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhelib_1_1_scratch_cell.html">helib::ScratchCell</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A class to help manage the allocation of temporary <a class="el" href="classhelib_1_1_ctxt.html" title="A Ctxt object holds a single ciphertext.">Ctxt</a> objects.  <a href="classhelib_1_1_scratch_cell.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhelib_1_1_add_d_a_g.html">helib::AddDAG</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A class representing the logic of the order of bit products when adding two integers.  <a href="classhelib_1_1_add_d_a_g.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structhelib_1_1_ptr_matrix___pt_ptr_vector.html">helib::PtrMatrix_PtPtrVector&lt; T &gt;</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">An implementation of <a class="el" href="structhelib_1_1_ptr_matrix.html" title="An abstract class for an array of PtrVectors.">PtrMatrix</a> using vector&lt; PtrVector&lt;T&gt;* &gt;  <a href="structhelib_1_1_ptr_matrix___pt_ptr_vector.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespacehelib"><td class="memItemLeft" align="right" valign="top"> &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html">helib</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a80e8cb52c5006048c742adf05e25a2d1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="binary_arith_8cpp.html#a80e8cb52c5006048c742adf05e25a2d1">BPL_ESTIMATE</a>&#160;&#160;&#160;(30)</td></tr>
<tr class="separator:a80e8cb52c5006048c742adf05e25a2d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a007ac83d6ec59826a48a73602b739510"><td class="memItemLeft" align="right" valign="top">typedef std::pair&lt; long, long &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#a007ac83d6ec59826a48a73602b739510">helib::NodeIdx</a></td></tr>
<tr class="separator:a007ac83d6ec59826a48a73602b739510"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:aa19a69725c1500ca956f0a89dd7226e8"><td class="memItemLeft" align="right" valign="top">long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#aa19a69725c1500ca956f0a89dd7226e8">helib::defaultPmiddle</a> (long delta)</td></tr>
<tr class="separator:aa19a69725c1500ca956f0a89dd7226e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ae485ed628fe5d0b73b7fc80efcfb36"><td class="memItemLeft" align="right" valign="top">long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#a7ae485ed628fe5d0b73b7fc80efcfb36">helib::defaultQmiddle</a> (long delta)</td></tr>
<tr class="separator:a7ae485ed628fe5d0b73b7fc80efcfb36"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aea4d00f74735017eb674bc25cca0d47d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#aea4d00f74735017eb674bc25cca0d47d">helib::packedRecrypt</a> (const CtPtrs &amp;a, const CtPtrs &amp;b, std::vector&lt; zzX &gt; *unpackSlotEncoding)</td></tr>
<tr class="memdesc:aea4d00f74735017eb674bc25cca0d47d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for packed recryption to recrypt multiple numbers.  <a href="namespacehelib.html#aea4d00f74735017eb674bc25cca0d47d">More...</a><br /></td></tr>
<tr class="separator:aea4d00f74735017eb674bc25cca0d47d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab0f609e8138ce597457cbf6168d27363"><td class="memItemLeft" align="right" valign="top">std::vector&lt; long &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#ab0f609e8138ce597457cbf6168d27363">helib::longToBitVector</a> (long num, long bitSize)</td></tr>
<tr class="memdesc:ab0f609e8138ce597457cbf6168d27363"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a number as a vector of bits with LSB on the left.  <a href="namespacehelib.html#ab0f609e8138ce597457cbf6168d27363">More...</a><br /></td></tr>
<tr class="separator:ab0f609e8138ce597457cbf6168d27363"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa08be8ce0b0f4ca1f870c56508889598"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#aa08be8ce0b0f4ca1f870c56508889598">helib::binaryMask</a> (CtPtrs &amp;binaryNums, const Ctxt &amp;mask)</td></tr>
<tr class="memdesc:aa08be8ce0b0f4ca1f870c56508889598"><td class="mdescLeft">&#160;</td><td class="mdescRight">Zeroes the slots of <code>binaryNums</code> where the corresponding slot of <code>mask</code> is 0.  <a href="namespacehelib.html#aa08be8ce0b0f4ca1f870c56508889598">More...</a><br /></td></tr>
<tr class="separator:aa08be8ce0b0f4ca1f870c56508889598"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6cc8eab5085d47ef2587ff4253ec5d77"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#a6cc8eab5085d47ef2587ff4253ec5d77">helib::binaryCond</a> (CtPtrs &amp;output, const Ctxt &amp;cond, const CtPtrs &amp;trueValue, const CtPtrs &amp;falseValue)</td></tr>
<tr class="memdesc:a6cc8eab5085d47ef2587ff4253ec5d77"><td class="mdescLeft">&#160;</td><td class="mdescRight">Implementation of <code>output = cond * trueValue + (1 - cond) * falseValue</code>.  <a href="namespacehelib.html#a6cc8eab5085d47ef2587ff4253ec5d77">More...</a><br /></td></tr>
<tr class="separator:a6cc8eab5085d47ef2587ff4253ec5d77"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab31dff00b9bd2df3454c7dc7a7edf16b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#ab31dff00b9bd2df3454c7dc7a7edf16b">helib::concatBinaryNums</a> (CtPtrs &amp;output, const CtPtrs &amp;a, const CtPtrs &amp;b)</td></tr>
<tr class="memdesc:ab31dff00b9bd2df3454c7dc7a7edf16b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Concatenates two binary numbers into a single <code>CtPtrs</code> object. E.g. If <code>a=10111</code>, <code>b=00101</code> then <code>output = 1011100101</code>.  <a href="namespacehelib.html#ab31dff00b9bd2df3454c7dc7a7edf16b">More...</a><br /></td></tr>
<tr class="separator:ab31dff00b9bd2df3454c7dc7a7edf16b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5442620f8d9b1e48c79e6d0c30eb9cec"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#a5442620f8d9b1e48c79e6d0c30eb9cec">helib::splitBinaryNums</a> (CtPtrs &amp;leftSplit, CtPtrs &amp;rightSplit, const CtPtrs &amp;input)</td></tr>
<tr class="memdesc:a5442620f8d9b1e48c79e6d0c30eb9cec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Splits a single binary number into two binary numbers <code>leftSplit</code> and <code>rightSplit</code>.  <a href="namespacehelib.html#a5442620f8d9b1e48c79e6d0c30eb9cec">More...</a><br /></td></tr>
<tr class="separator:a5442620f8d9b1e48c79e6d0c30eb9cec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac577a548455a706fa164247e3801e05a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#ac577a548455a706fa164247e3801e05a">helib::leftBitwiseShift</a> (CtPtrs &amp;output, const CtPtrs &amp;input, const long shamt)</td></tr>
<tr class="memdesc:ac577a548455a706fa164247e3801e05a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Left shift <code>input</code> by <code>shamt</code>.  <a href="namespacehelib.html#ac577a548455a706fa164247e3801e05a">More...</a><br /></td></tr>
<tr class="separator:ac577a548455a706fa164247e3801e05a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7a59ff05d1c4f1800bb2010e451576ab"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#a7a59ff05d1c4f1800bb2010e451576ab">helib::bitwiseRotate</a> (CtPtrs &amp;output, const CtPtrs &amp;input, long rotamt)</td></tr>
<tr class="memdesc:a7a59ff05d1c4f1800bb2010e451576ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Rotate <code>input</code> by <code>rotamt</code>.  <a href="namespacehelib.html#a7a59ff05d1c4f1800bb2010e451576ab">More...</a><br /></td></tr>
<tr class="separator:a7a59ff05d1c4f1800bb2010e451576ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abaa682a93edca39cb5ce5524219c486c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#abaa682a93edca39cb5ce5524219c486c">helib::bitwiseXOR</a> (CtPtrs &amp;output, const CtPtrs &amp;lhs, const CtPtrs &amp;rhs)</td></tr>
<tr class="memdesc:abaa682a93edca39cb5ce5524219c486c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute a bitwise XOR between <code>lhs</code> and <code>rhs</code>.  <a href="namespacehelib.html#abaa682a93edca39cb5ce5524219c486c">More...</a><br /></td></tr>
<tr class="separator:abaa682a93edca39cb5ce5524219c486c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2928d18450500f401e36d50a8288bf0e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#a2928d18450500f401e36d50a8288bf0e">helib::bitwiseOr</a> (CtPtrs &amp;output, const CtPtrs &amp;lhs, const CtPtrs &amp;rhs)</td></tr>
<tr class="memdesc:a2928d18450500f401e36d50a8288bf0e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute a bitwise OR between <code>lhs</code> and <code>rhs</code>.  <a href="namespacehelib.html#a2928d18450500f401e36d50a8288bf0e">More...</a><br /></td></tr>
<tr class="separator:a2928d18450500f401e36d50a8288bf0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e4ba60fb6ef861f9601a3c22c589315"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#a6e4ba60fb6ef861f9601a3c22c589315">helib::bitwiseAnd</a> (CtPtrs &amp;output, const CtPtrs &amp;lhs, const CtPtrs &amp;rhs)</td></tr>
<tr class="memdesc:a6e4ba60fb6ef861f9601a3c22c589315"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute a bitwise AND between <code>lhs</code> and <code>rhs</code>.  <a href="namespacehelib.html#a6e4ba60fb6ef861f9601a3c22c589315">More...</a><br /></td></tr>
<tr class="separator:a6e4ba60fb6ef861f9601a3c22c589315"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a95a2868fe4324ee643869930d159f8ff"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#a95a2868fe4324ee643869930d159f8ff">helib::bitwiseAnd</a> (CtPtrs &amp;output, const CtPtrs &amp;input, const std::vector&lt; long &gt; mask)</td></tr>
<tr class="memdesc:a95a2868fe4324ee643869930d159f8ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute a bitwise AND between <code>input</code> and a <code>std::vector&lt;long&gt;</code>.  <a href="namespacehelib.html#a95a2868fe4324ee643869930d159f8ff">More...</a><br /></td></tr>
<tr class="separator:a95a2868fe4324ee643869930d159f8ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3bc4da63675257eacdf323d32ca23a83"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#a3bc4da63675257eacdf323d32ca23a83">helib::bitwiseNot</a> (CtPtrs &amp;output, const CtPtrs &amp;input)</td></tr>
<tr class="memdesc:a3bc4da63675257eacdf323d32ca23a83"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute a bitwise NOT of <code>input</code>.  <a href="namespacehelib.html#a3bc4da63675257eacdf323d32ca23a83">More...</a><br /></td></tr>
<tr class="separator:a3bc4da63675257eacdf323d32ca23a83"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a277237f0883421a2abee740db9f1b6ef"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#a277237f0883421a2abee740db9f1b6ef">helib::addTwoNumbers</a> (CtPtrs &amp;sum, const CtPtrs &amp;lhs, const CtPtrs &amp;rhs, long sizeLimit=0, std::vector&lt; zzX &gt; *unpackSlotEncoding=nullptr)</td></tr>
<tr class="memdesc:a277237f0883421a2abee740db9f1b6ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds two numbers in binary representation where each ciphertext of the input vector contains a bit.  <a href="namespacehelib.html#a277237f0883421a2abee740db9f1b6ef">More...</a><br /></td></tr>
<tr class="separator:a277237f0883421a2abee740db9f1b6ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaff515cbc7e22db14c0b22c910f4cee2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#aaff515cbc7e22db14c0b22c910f4cee2">helib::negateBinary</a> (CtPtrs &amp;negation, const CtPtrs &amp;input)</td></tr>
<tr class="memdesc:aaff515cbc7e22db14c0b22c910f4cee2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Negates a number in binary 2's complement representation.  <a href="namespacehelib.html#aaff515cbc7e22db14c0b22c910f4cee2">More...</a><br /></td></tr>
<tr class="separator:aaff515cbc7e22db14c0b22c910f4cee2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3828f8e07ee92999ebe6163fb96c5fd5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#a3828f8e07ee92999ebe6163fb96c5fd5">helib::subtractBinary</a> (CtPtrs &amp;difference, const CtPtrs &amp;lhs, const CtPtrs &amp;rhs, std::vector&lt; zzX &gt; *unpackSlotEncoding=nullptr)</td></tr>
<tr class="memdesc:a3828f8e07ee92999ebe6163fb96c5fd5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Subtracts <code>rhs</code> from <code>lhs</code> where <code>lhs</code>, <code>rhs</code> are in 2's complement.  <a href="namespacehelib.html#a3828f8e07ee92999ebe6163fb96c5fd5">More...</a><br /></td></tr>
<tr class="separator:a3828f8e07ee92999ebe6163fb96c5fd5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a34e793367187e97095f9f2590eb4dc5e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#a34e793367187e97095f9f2590eb4dc5e">helib::addManyNumbers</a> (CtPtrs &amp;sum, CtPtrMat &amp;numbers, long sizeLimit=0, std::vector&lt; zzX &gt; *unpackSlotEncoding=nullptr)</td></tr>
<tr class="memdesc:a34e793367187e97095f9f2590eb4dc5e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sum an arbitrary amount of numbers in binary representation.  <a href="namespacehelib.html#a34e793367187e97095f9f2590eb4dc5e">More...</a><br /></td></tr>
<tr class="separator:a34e793367187e97095f9f2590eb4dc5e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa9936528f7b1f6865e4a496047caba21"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#aa9936528f7b1f6865e4a496047caba21">helib::multTwoNumbers</a> (CtPtrs &amp;product, const CtPtrs &amp;lhs, const CtPtrs &amp;rhs, bool rhsTwosComplement=false, long sizeLimit=0, std::vector&lt; zzX &gt; *unpackSlotEncoding=nullptr)</td></tr>
<tr class="memdesc:aa9936528f7b1f6865e4a496047caba21"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiply two numbers in binary representation where each ciphertext of the input vector contains a bit.  <a href="namespacehelib.html#aa9936528f7b1f6865e4a496047caba21">More...</a><br /></td></tr>
<tr class="separator:aa9936528f7b1f6865e4a496047caba21"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a635ecc26ac755424a9f834d4eca7d68e"><td class="memItemLeft" align="right" valign="top">long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#a635ecc26ac755424a9f834d4eca7d68e">helib::fifteenOrLess4Four</a> (const CtPtrs &amp;out, const CtPtrs &amp;in, long sizeLimit=4)</td></tr>
<tr class="memdesc:a635ecc26ac755424a9f834d4eca7d68e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add together up to fifteen {0,1} integers, producing a 4-bit counter.  <a href="namespacehelib.html#a635ecc26ac755424a9f834d4eca7d68e">More...</a><br /></td></tr>
<tr class="separator:a635ecc26ac755424a9f834d4eca7d68e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1285dad7ef04a62fde04003b87ee1110"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehelib.html#a1285dad7ef04a62fde04003b87ee1110">helib::decryptBinaryNums</a> (std::vector&lt; long &gt; &amp;pNums, const CtPtrs &amp;eNums, const SecKey &amp;sKey, const EncryptedArray &amp;ea, bool twosComplement=false, bool allSlots=true)</td></tr>
<tr class="memdesc:a1285dad7ef04a62fde04003b87ee1110"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decrypt the binary numbers that are encrypted in eNums.  <a href="namespacehelib.html#a1285dad7ef04a62fde04003b87ee1110">More...</a><br /></td></tr>
<tr class="separator:a1285dad7ef04a62fde04003b87ee1110"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Implementing integer addition, multiplication in binary representation. </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a80e8cb52c5006048c742adf05e25a2d1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a80e8cb52c5006048c742adf05e25a2d1">&#9670;&nbsp;</a></span>BPL_ESTIMATE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BPL_ESTIMATE&#160;&#160;&#160;(30)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.8-->
<!-- start footer part -->
</div>
</div>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
        <script type="text/javascript" src="doxy-boot.js"></script>
</html>
